//
//  KTabBarController.m
//  TimeToCoin
//
//  Created by 1-Mac on 2018/8/1.
//  Copyright © 2018年 QuanLi Technology Limited. All rights reserved.
//

#import "KTabBarController.h"

@interface KTabBarController ()<UITabBarDelegate>

@end

@implementation KTabBarController


- (void)viewDidLoad {
    [super viewDidLoad];
    
    
//    [self TabBarTitleColor];
//    [self setTabBarAllControl];
    
}

#pragma mark - 设置TabBar图片下面字体的颜色
-(void)setTabBarTitleColorStateNormal:(UIColor *)colorNormal
                        StateSelected:(UIColor *)colorSelected
                          StateNormal:(CGFloat)fontNormal
                          StateNormal:(CGFloat)fontSelected{
    //未选中字体颜色
    [[UITabBarItem appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName:colorNormal,NSFontAttributeName:[UIFont systemFontOfSize:fontNormal]} forState:UIControlStateNormal];
    
    
    //选中字体颜色
    [[UITabBarItem appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName:colorSelected,NSFontAttributeName:[UIFont systemFontOfSize:fontSelected]} forState:UIControlStateSelected];
}

#pragma mark - 创建TabBar
//-(void)setTabBarAllControl
//{
//    KHomePageViewController * home = [[KHomePageViewController alloc] init];
//
//    [self setUpOneChildViewControl:home image:[UIImage imageNamed:nil] selectedImage:[UIImage imageNamed:nil] title:@"首页"];
//
//    KTabBar * tabbar = [[KTabBar alloc] init];
////    tabbar.delegate = self;∫
//    [self setValue:tabbar forKey:@"tabBar"];
//}

#pragma mark - 设置TabBar图片以及文本和跳转的控制器
-(void)setUpOneChildViewControl:(UIViewController *)vc image:(UIImage *)image selectedImage:(UIImage *)selectedImage title:(NSString *)title
{
    vc.title = title;
    vc.tabBarItem.image         = image;
    vc.tabBarItem.selectedImage = selectedImage;
    
    
    //设置导航条
//    WJNavigationViewController * nav = [[WJNavigationViewController alloc] initWithRootViewController:vc];
    
//    [self addChildViewController:nav];
}




@end
